public class Solution633 {
    public boolean judgeSquareSum(int c) {
        for (int i=0;i<46341 && i*i<=c;i++){
            int t=c-i*i;
            if ((int)Math.sqrt(t)*(int)Math.sqrt(t)==t){
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        System.out.println(new Solution633().judgeSquareSum(5));
    }
}
